*------------------------------------------------------------------------------*
* 	Table 5: Gift Experiment - OLS		 	   *
*------------------------------------------------------------------------------*
{
cd "$data"
use ExperimentalData_Officers_All, clear

* TABLE V. Gift Experiment - OLS

**** columns (1) and (2)

local off_female off_female
local regionbankfe d_region_bank_fe1-d_region_bank_fe61
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12

foreach outcome of varlist give_ticket {

            *all executives
			regress `outcome' ticket_female `off_female' `regionbankfe'  `type' `execcovariates', r
			sum `outcome' if ticket_female==0
			local mean_masculine = r(mean)
			outreg2 ticket_female using "${tables}/Table5_col_1_r.xls", keep(ticket_female) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"            
            regress `outcome' ticket_female##pro_male_portfolio `off_female' `regionbankfe'  `type' `execcovariates', r
			sum `outcome' if ticket_female==0
			local mean_masculine = r(mean)
			outreg2 1.ticket_female 1.pro_male_portfolio 1.ticket_female#1.pro_male_portfolio using "${tables}/Table5_col_2_r.xls", keep(1.pro_male_portfolio 1.ticket_female 1.ticket_female#1.pro_male_portfolio) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"            
}

			
**** columns (3) and (4)

local regionbankfemale d_region_bank_fe_male1-d_region_bank_fe_male37
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12
			
foreach outcome of varlist give_ticket {

			*only male executives
			regress `outcome' ticket_female `regionbankfemale'  `type' `execcovariates'  if off_female==0, r
			sum `outcome' if ticket_female==0 & off_female==0
			local mean_masculine = r(mean)
			outreg2 ticket_female using "${tables}/Table5_col_3_r.xls", keep(ticket_female) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"            
            regress `outcome' ticket_female##pro_male_portfolio `regionbankfemale' `type'  `execcovariates' if off_female==0, r
			sum `outcome' if ticket_female==0 & off_female==0
			local mean_masculine = r(mean)
			outreg2 1.ticket_female 1.pro_male_portfolio  1.ticket_female#1.pro_male_portfolio using "${tables}/Table5_col_4_r.xls", keep(1.pro_male_portfolio 1.ticket_female 1.ticket_female#1.pro_male_portfolio) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"  
}


**** columns (5) and (6)

local regionbankfefemale d_region_bank_fe_fem1-d_region_bank_fe_fem53
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12
			
foreach outcome of varlist give_ticket {
			*only female executives
			regress `outcome' ticket_female `regionbankfefemale'  `type' `execcovariates'  if off_female==1, r
			sum `outcome' if ticket_female==0 & off_female==1
			local mean_masculine = r(mean)
			outreg2 ticket_female using "${tables}/Table5_col_5_r.xls", keep(ticket_female) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"            
            regress `outcome' ticket_female##pro_male_portfolio `regionbankfefemale' `type'  `execcovariates' if off_female==1, r
			sum `outcome' if ticket_female==0 & off_female==1
			local mean_masculine = r(mean)
			outreg2 1.ticket_female 1.pro_male_portfolio 1.ticket_female#1.pro_male_portfolio using "${tables}/Table5_col_6_r.xls", keep(1.pro_male_portfolio 1.ticket_female 1.ticket_female#1.pro_male_portfolio) addstat("mean_masculine", `mean_masculine') adec(3) excel `append' bdec(3) sdec(3) stats(coef se) auto(3) alpha(.01, .05, .10) symbol(***,**,*) br
            local append "append"

			}           
          		  
*Multiple Hypotheses Testing: MHT p-val. follows List et al. (2021), Theorem 3.1., to report the multiplicity adjusted p-value for multiple hypothesis testing (3,000 reps.) of H0: \beta_Donee'sNameisFeminine = 0 (models (1), (3), and (5)) and H0: \beta_Donee'sNameisFeminine X OfficerisPro-Male = 0 (models (2), (4), and (6)), controlling for the specified covariates in each referred model.

sort aux 

*columns (1), (3) and (5) MHT p-v. (bt)

local off_female off_female
local regionbankfe d_region_bank_fe1-d_region_bank_fe61
local regionbankfemale d_region_bank_fe_male1-d_region_bank_fe_male37
local regionbankfefemale d_region_bank_fe_fem1-d_region_bank_fe_fem53
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12

mhtreg ( give_ticket  ticket_female  `off_female' `regionbankfe'  `type' `execcovariates') ///
 	   ( give_ticket  ticket_female  `regionbankfemale' `type' `execcovariates' if off_female==0) ///
	   ( give_ticket  ticket_female  `regionbankfefemale' `type' `execcovariates' if off_female==1), /// 
	   seed(10101010101) bootstrap(3000)

*columns (2), (4) and (6) MHT p-v. (bt)

gen fem_pm = ticket_female*pro_male_portfolio

sort aux 

local off_female off_female
local regionbankfe d_region_bank_fe1-d_region_bank_fe61
local regionbankfemale d_region_bank_fe_male1-d_region_bank_fe_male37
local regionbankfefemale d_region_bank_fe_fem1-d_region_bank_fe_fem53
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12

mhtreg ( give_ticket fem_pm ticket_female pro_male_portfolio `off_female' `regionbankfe'  `type' `execcovariates') ///
 	   ( give_ticket fem_pm ticket_female pro_male_portfolio `regionbankfemale' `type' `execcovariates' if off_female==0) ///
	   ( give_ticket fem_pm ticket_female pro_male_portfolio `regionbankfefemale' `type' `execcovariates' if  off_female==1), /// 
	   seed(10101010101) bootstrap(3000)
	   

	   
	   
*Using Frisch-Waug to compute bootstrapped standard errors

sort aux 

local off_female off_female
local regionbankfe d_region_bank_fe1-d_region_bank_fe61
local regionbankfemale d_region_bank_fe_male1-d_region_bank_fe_male37
local regionbankfefemale d_region_bank_fe_fem1-d_region_bank_fe_fem53
local type type1 type2
local execcovariates off_higher_educ off_exp_6_or_less off_exp_7_to_12

***column (1)

*partialling out give_ticket for ticket_female
reg give_ticket `off_female' `regionbankfe'  `type' `execcovariates'
predict tilda_ticket_female, res

*partialling out ticket_female
reg ticket_female `off_female' `regionbankfe'  `type' `execcovariates'
predict ticket_female_tilda, res

*frisch-waugh ticket_female
reg tilda_ticket_female ticket_female_tilda, vce(boot, rep(3000) seed(1010101))

***column (2)

*partialling out give_ticket for ticket_female
reg give_ticket pro_male_portfolio fem_pm `off_female' `regionbankfe'  `type' `execcovariates'
predict tilda_ticket_female2, res

*partialling out give_ticket for pro_male_portfolio
reg give_ticket ticket_female fem_pm `off_female' `regionbankfe'  `type' `execcovariates'
predict tilda_promale2, res

*partialling out give_ticket for fem_pm
reg give_ticket ticket_female pro_male_portfolio `off_female' `regionbankfe'  `type' `execcovariates'
predict tilda_fem_pm2, res

*partialling out ticket_female
reg ticket_female fem_pm pro_male_portfolio `off_female' `regionbankfe'  `type' `execcovariates'
predict ticket_female_tilda2, res

*partialling out promale_officer
reg pro_male_portfolio ticket_female fem_pm `off_female' `regionbankfe'  `type' `execcovariates'
predict promale_tilda2, res

*partialling out fem_pm
reg fem_pm pro_male_portfolio ticket_female `off_female' `regionbankfe'  `type' `execcovariates'
predict fem_pm_tilda2, res

*frisch-waugh ticket_female
reg tilda_ticket_female2 ticket_female_tilda2, vce(boot, rep(3000) seed(1010101))
*frisch-waugh promale_officer
reg tilda_promale2 promale_tilda2, vce(boot, rep(3000) seed(1010101))
*frisch-waugh fem_pm
reg tilda_fem_pm2 fem_pm_tilda2, vce(boot, rep(3000) seed(1010101))

***column (3)

*partialling out give_ticket for ticket_female
reg give_ticket `off_female' `regionbankfemale'  `type' `execcovariates'   if off_female==0
predict tilda_ticket_female3, res

*partialling out ticket_female
reg ticket_female `off_female' `regionbankfemale'  `type' `execcovariates'  if off_female==0
predict ticket_female_tilda3, res

*frisch-waugh ticket_female
reg tilda_ticket_female3 ticket_female_tilda3  if off_female==0, vce(boot, rep(3000) seed(1010101))

***column (4)

*partialling out give_ticket for ticket_female
reg give_ticket pro_male_portfolio fem_pm `off_female' `regionbankfemale'  `type' `execcovariates' if off_female==0
predict tilda_ticket_female4, res

*partialling out give_ticket for pro_male_portfolio
reg give_ticket ticket_female fem_pm `off_female' `regionbankfemale'  `type' `execcovariates'  if off_female==0
predict tilda_promale4, res

*partialling out give_ticket for fem_pm
reg give_ticket ticket_female pro_male_portfolio `off_female' `regionbankfemale'  `type' `execcovariates' if off_female==0
predict tilda_fem_pm4, res

*partialling out ticket_female
reg ticket_female fem_pm pro_male_portfolio `off_female' `regionbankfemale'  `type' `execcovariates'  if off_female==0
predict ticket_female_tilda4, res

*partialling out promale_officer
reg pro_male_portfolio ticket_female fem_pm `off_female' `regionbankfemale'  `type' `execcovariates' if off_female==0
predict promale_tilda4, res

*partialling out fem_pm
reg fem_pm pro_male_portfolio ticket_female `off_female' `regionbankfemale'  `type' `execcovariates' if off_female==0
predict fem_pm_tilda4, res

*frisch-waugh ticket_female
reg tilda_ticket_female4 ticket_female_tilda4  if off_female==0, vce(boot, rep(3000) seed(1010101))
*frisch-waugh promale_officer
reg tilda_promale4 promale_tilda4  if off_female==0, vce(boot, rep(3000) seed(1010101))
*frisch-waugh fem_pm
reg tilda_fem_pm4 fem_pm_tilda4  if off_female==0, vce(boot, rep(3000) seed(1010101))
	   
***column (5)

*partialling out give_ticket for ticket_female
reg give_ticket `off_female' `regionbankfefemale'  `type' `execcovariates'   if off_female==1
predict tilda_ticket_female5, res

*partialling out ticket_female
reg ticket_female `off_female' `regionbankfefemale'  `type' `execcovariates'  if off_female==1
predict ticket_female_tilda5, res

*frisch-waugh ticket_female
reg tilda_ticket_female5 ticket_female_tilda5  if off_female==1, vce(boot, rep(3000) seed(1010101))

***column (6)

*partialling out give_ticket for ticket_female
reg give_ticket pro_male_portfolio fem_pm `off_female' `regionbankfefemale'  `type' `execcovariates' if off_female==1
predict tilda_ticket_female6, res

*partialling out give_ticket for pro_male_portfolio
reg give_ticket ticket_female fem_pm `off_female' `regionbankfefemale'  `type' `execcovariates'  if off_female==1
predict tilda_promale6, res

*partialling out give_ticket for fem_pm
reg give_ticket ticket_female pro_male_portfolio `off_female' `regionbankfefemale'  `type' `execcovariates' if  off_female==1
predict tilda_fem_pm6, res

*partialling out ticket_female
reg ticket_female fem_pm pro_male_portfolio `off_female' `regionbankfefemale'  `type' `execcovariates'  if  off_female==1
predict ticket_female_tilda6, res

*partialling out promale_officer
reg pro_male_portfolio ticket_female fem_pm `off_female' `regionbankfefemale'  `type' `execcovariates' if off_female==1
predict promale_tilda6, res

*partialling out fem_pm
reg fem_pm pro_male_portfolio ticket_female `off_female' `regionbankfefemale'  `type' `execcovariates' if  off_female==1
predict fem_pm_tilda6, res

*frisch-waugh ticket_female
reg tilda_ticket_female6 ticket_female_tilda6  if off_female==1, vce(boot, rep(3000) seed(1010101))
*frisch-waugh promale_officer
reg tilda_promale6 promale_tilda6  if  off_female==1, vce(boot, rep(3000) seed(1010101))
*frisch-waugh fem_pm
reg tilda_fem_pm6 fem_pm_tilda6  if  off_female==1, vce(boot, rep(3000) seed(1010101))	   


	   
	   
}
        

